<?php

/*
*/
class Model
{
	protected $db=null;
	protected $mem=null;
	//private $tb=null;
	public function __construct()
	{
		
		$this->db=sql::getIns();
		$this->mem=Mem::getIns();
		//$this->mem=new Heap();
	}

	/*

	//根据需要获取信息
	public function getsome($proprety_value,$data,$proprety='id',$tb='')
	{
		$tb==''?$tb=$this->tb:'';
		$sql="select ".implode(',', array_values($data))." from $tb where $proprety=$proprety_value";
		//var_dump($sql);

		return $this->db->getRow($sql);
	}

	//根据需要设置信息
	public function setsome($uid,$data,$tb='')
	{
		$tb==''?$tb=$this->tb:'';
		return  $this->db->update($tb,$data,$uid);
	}

	//根据需要获取单个信息
	public function getone($value,$attr,$proprety='id',$tb='')
	{
		$tb==''?$tb=$this->tb:'';
		$sql="select $attr from $tb where $proprety=$value";

		return $this->db->getOne($sql);
	}
	//根据需要获取单个信息
	public function setone($proprety_value,$attr,$val,$proprety='id',$tb='')
	{
		$tb==''?$tb=$this->tb:'';
		$sql="update $tb set $attr=$val where $proprety=$proprety_value";

		return $this->db->setOne($sql);
	}
	*/

}